<div class="page-header">
    <h3><?php echo lang('projects'); ?></h3>
</div>

<?php
if(!isset($projects)):
echo '<p>'.lang('no_projects').'</p>';
else:
?>

<table class="table table-condensed">
    <thead>
        <tr>
            <th><?php echo lang('start_date'); ?></th>
            <th><?php echo lang('end_date'); ?></th>
            <th><?php echo lang('title'); ?></th>
            <th><?php echo lang('teacher'); ?></th>
        </tr>
    </thead>
    <tbody class="well">
        <?php
        foreach($projects as $project):
        ?>
        <tr>
            <td><?php echo $project['start_date'].' '.$project['start_time']; ?></td>
            <td><?php echo $project['end_date'].' '.$project['end_time']; ?></td>
            <td><?php echo anchor('projects/view/'.$project['id'], $project['title']); ?></td>
            <td><?php echo anchor('user_profiles/view/'.$project['teacher_id'], (($project['teacher_id'] === $user_id) ? lang('me') : $project['teacher'])); ?></td>
        </tr>
        <?php
        endforeach;
        ?>
    </tbody>
</table>

<?php
endif;